package com.example.test;

import com.example.normal.config.TestConfig;
import com.example.normal.config.TestProperties;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;

@SpringBootTest
public class ReadConfig {

    @Resource
    private TestConfig testConfig;

    @Resource
    private TestProperties testProperties;

    @Test
    public void readYml() {
        System.out.println("使用Bean读取："+testConfig.getMyConfigByMethod());
        System.out.println("使用Lombok读取："+testConfig.getMyConfig());
        System.out.println("使用Lombok读取1："+testConfig.getMyConfig1());
    }

    @Test
    public void readProperties() {
        System.out.println("读取："+testProperties.getMyConfig());
    }
}
